/**
 * 延迟执行
 * @param func 
 * @param timeout 
 */
export function delay(timeout: number): Promise<void> {
  return new Promise((resolve) => {
    setTimeout(resolve, timeout);
  })
}

/**
 * mapToArray
 */
export function mapToArray(enums) {
  let result: {
    label: string,
    value: number | string
  }[] = [];
  for(const key in enums) {
    result.push({
      label: enums[key],
      value: key
    })
  }
  return result;
}